Dynomotion

Group: DynoMotion Message: 3263 From: bradodarb Date: 1/22/2012
Subject: Gcode Interpreter Feature Request
Hello Tom,


I have been implementing a c# version of the NIST EMC RS274 interpreter.

In the source file driver.cc, you will find to means of feeding commands to the interpreter; interpret_from_file(args...) and interpret_from_keyboard(args...)

I am sure you are aware of the keyboard function, as it looks like you used the standalone version of the interpreter and placed coordmotion calls/io state changes/etc.. in the canonical callbacks.

Can you please expose this to GcodeInterpreter so we can have proper MDI support natively on the kflop?

Here is the funtion in question::

int interpret_from_keyboard( /* ARGUMENTS */
int block_delete, /* switch which is ON or OFF */
int print_stack) /* option which is ON or OFF */
{
char line[RS274NGC_TEXT_SIZE];
int status;

for(; ;)
{
printf("READ => ");
gets(line);
if (strcmp (line, "quit") IS 0)
return 0;
status SET_TO rs274ngc_read(line);
if ((status IS RS274NGC_EXECUTE_FINISH) AND (block_delete IS ON));
else if (status IS RS274NGC_ENDFILE);
else if ((status ISNT RS274NGC_EXECUTE_FINISH) AND
(status ISNT RS274NGC_OK))
report_error(status, print_stack);
else
{
status SET_TO rs274ngc_execute();
if ((status IS RS274NGC_EXIT) OR
(status IS RS274NGC_EXECUTE_FINISH));
else if (status ISNT RS274NGC_OK)
report_error(status, print_stack);
}
}
}

Thanks,

Brad Murry
Group: DynoMotion Message: 3282 From: Tom Kerekes Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request
Hi Brad,
 
We already have "proper" MDI functionality :}
 
I guess you are referring to the issue where the current technique involves creating a 1 line file to execute.  I agree it wastes 100us of CPU time, but it only happens as fast as a person can type or click so it is negligible.  The benefit is it guarantees exact same functionality as single stepping through a file.
 
Maybe I don't understand the issue.  But the function you mention seems like is some command line thing where the user is expected to type "quit" and so forth.  Is that what you really want?  Also there are a number of things that need to be setup before calling the Interpreter with regard to Initializing the Coordinated Motion, the TP, the State Tracker, Callbacks, etc...  Also a Thread should be created because the call could block for a long time.  Also everything needs to be flushed afterward so the motion begins, finishes, and errors are handled.
 
If you could explain the need a bit more, and do all the work and testing :}  We could merge in the changes as long as it doesn't impact existing code.
 
Regards
TK
 

Group: DynoMotion Message: 3284 From: himykabibble Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request
I kinda like the fact that MDI uses exactly the same I/F as running a program. Mach3 does not really do that, and it caused me grief at times. This seems to me more "bullet-proof", since the interpreter neither knows nor cares where the Gcode comes from - it's all the same.

Regards,
Ray L

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Brad,
>  
> We already have "proper" MDI functionality :}
>  
> I guess you are referring to the issue where the current technique involves creating a 1 line file to execute.  I agree it wastes 100us of CPU time, but it only happens as fast as a person can type or click so it is negligible.  The benefit is it guarantees exact same functionality as single stepping through a file.
>  
> Maybe I don't understand the issue.  But the function you mention seems like is some command line thing where the user is expected to type "quit" and so forth.  Is that what you really want?  Also there are a number of things that need to be setup before calling the Interpreter with regard to Initializing the Coordinated Motion, the TP, the State Tracker, Callbacks, etc...  Also a Thread should be created because the call could block for a long time.  Also everything needs to be flushed afterward so the motion begins, finishes, and errors are handled.
>  
> If you could explain the need a bit more, and do all the work and testing :}  We could merge in the changes as long as it doesn't impact existing code.
>  
> Regards
> TK
>  
>
> From: bradodarb <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, January 22, 2012 9:20 AM
> Subject: [DynoMotion] Gcode Interpreter Feature Request
>
>
>  
> Hello Tom,
>
> I have been implementing a c# version of the NIST EMC RS274 interpreter.
>
> In the source file driver.cc, you will find to means of feeding commands to the interpreter; interpret_from_file(args...) and interpret_from_keyboard(args...)
>
> I am sure you are aware of the keyboard function, as it looks like you used the standalone version of the interpreter and placed coordmotion calls/io state changes/etc.. in the canonical callbacks.
>
> Can you please expose this to GcodeInterpreter so we can have proper MDI support natively on the kflop?
>
> Here is the funtion in question::
>
> int interpret_from_keyboard( /* ARGUMENTS */
> int block_delete, /* switch which is ON or OFF */
> int print_stack) /* option which is ON or OFF */
> {
> char line[RS274NGC_TEXT_SIZE];
> int status;
>
> for(; ;)
> {
> printf("READ => ");
> gets(line);
> if (strcmp (line, "quit") IS 0)
> return 0;
> status SET_TO rs274ngc_read(line);
> if ((status IS RS274NGC_EXECUTE_FINISH) AND (block_delete IS ON));
> else if (status IS RS274NGC_ENDFILE);
> else if ((status ISNT RS274NGC_EXECUTE_FINISH) AND
> (status ISNT RS274NGC_OK))
> report_error(status, print_stack);
> else
> {
> status SET_TO rs274ngc_execute();
> if ((status IS RS274NGC_EXIT) OR
> (status IS RS274NGC_EXECUTE_FINISH));
> else if (status ISNT RS274NGC_OK)
> report_error(status, print_stack);
> }
> }
> }
>
> Thanks,
>
> Brad Murry
>
Group: DynoMotion Message: 3291 From: Brad Murry Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request

Hello Tom,

 

I’m glad you can take ‘proper’ with a sense of humor ;)

 

I do like that the interpreter functions the same, but there is one sticking point that makes me want to side step it.

 

The problem is you cannot issue anything during running a program.

 

Normally, you would not need to, but sometimes(especially during setup of a new program) you may throw an M00 so you check things.

 

During this M00 you may want to toggle Mcodes, etc….  Arguably you can perform IO calls with buttons, but most NC controls allow commands to be interpreted while a program is being executed.  Another common use is to change tool heights, etc….

 

If you can put it in the GcodeInterpreter.cpp side  I will happily integrate it to the .net side(meet me half way?)

 

-Brad Murry

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: Sunday, January 22, 2012 12:43 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Gcode Interpreter Feature Request

 

 

Hi Brad,

 

We already have "proper" MDI functionality :}

 

I guess you are referring to the issue where the current technique involves creating a 1 line file to execute.  I agree it wastes 100us of CPU time, but it only happens as fast as a person can type or click so it is negligible.  The benefit is it guarantees exact same functionality as single stepping through a file.

 

Maybe I don't understand the issue.  But the function you mention seems like is some command line thing where the user is expected to type "quit" and so forth.  Is that what you really want?  Also there are a number of things that need to be setup before calling the Interpreter with regard to Initializing the Coordinated Motion, the TP, the State Tracker, Callbacks, etc...  Also a Thread should be created because the call could block for a long time.  Also everything needs to be flushed afterward so the motion begins, finishes, and errors are handled.

 

If you could explain the need a bit more, and do all the work and testing :}  We could merge in the changes as long as it doesn't impact existing code.

 

Regards

TK

 

 

From: bradodarb <bradodarb@...>
To: DynoMotion@yahoogroups.com
Sent: Sunday, January 22, 2012 9:20 AM
Subject: [DynoMotion] Gcode Interpreter Feature Request

 

 

Hello Tom,

I have been implementing a c# version of the NIST EMC RS274 interpreter.

In the source file driver.cc, you will find to means of feeding commands to the interpreter; interpret_from_file(args...) and interpret_from_keyboard(args...)

I am sure you are aware of the keyboard function, as it looks like you used the standalone version of the interpreter and placed coordmotion calls/io state changes/etc.. in the canonical callbacks.

Can you please expose this to GcodeInterpreter so we can have proper MDI support natively on the kflop?

Here is the funtion in question::

int interpret_from_keyboard( /* ARGUMENTS */
int block_delete, /* switch which is ON or OFF */
int print_stack) /* option which is ON or OFF */
{
char line[RS274NGC_TEXT_SIZE];
int status;

for(; ;)
{
printf("READ => ");
gets(line);
if (strcmp (line, "quit") IS 0)
return 0;
status SET_TO rs274ngc_read(line);
if ((status IS RS274NGC_EXECUTE_FINISH) AND (block_delete IS ON));
else if (status IS RS274NGC_ENDFILE);
else if ((status ISNT RS274NGC_EXECUTE_FINISH) AND
(status ISNT RS274NGC_OK))
report_error(status, print_stack);
else
{
status SET_TO rs274ngc_execute();
if ((status IS RS274NGC_EXIT) OR
(status IS RS274NGC_EXECUTE_FINISH));
else if (status ISNT RS274NGC_OK)
report_error(status, print_stack);
}
}
}

Thanks,

Brad Murry

 

Group: DynoMotion Message: 3295 From: himykabibble Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request
"The problem is you cannot issue anything during running a program." - JMTCW - I HATE that idea. That is the kind of thing that caused me no end of grief in Mach3. Allowing injection of MDI commands like that REALLY complicates things, and (in my limited experience) I have a hard time seeing a legitimate reason to do that. To me, that's what FeedHold is for - you can strop the program, do what you need to do, then continue.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@...> wrote:
>
> Hello Tom,
>
>
>
> I’m glad you can take ‘proper’ with a sense of humor ;)
>
>
>
> I do like that the interpreter functions the same, but there is one sticking point that makes me want to side step it.
>
>
>
> The problem is you cannot issue anything during running a program.
>
>
>
> Normally, you would not need to, but sometimes(especially during setup of a new program) you may throw an M00 so you check things.
>
>
>
> During this M00 you may want to toggle Mcodes, etc…. Arguably you can perform IO calls with buttons, but most NC controls allow commands to be interpreted while a program is being executed. Another common use is to change tool heights, etc….
>
>
>
> If you can put it in the GcodeInterpreter.cpp side I will happily integrate it to the .net side(meet me half way?)
>
>
>
> -Brad Murry
>
>
>
> From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: Sunday, January 22, 2012 12:43 PM
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Gcode Interpreter Feature Request
>
>
>
>
>
> Hi Brad,
>
>
>
> We already have "proper" MDI functionality :}
>
>
>
> I guess you are referring to the issue where the current technique involves creating a 1 line file to execute. I agree it wastes 100us of CPU time, but it only happens as fast as a person can type or click so it is negligible. The benefit is it guarantees exact same functionality as single stepping through a file.
>
>
>
> Maybe I don't understand the issue. But the function you mention seems like is some command line thing where the user is expected to type "quit" and so forth. Is that what you really want? Also there are a number of things that need to be setup before calling the Interpreter with regard to Initializing the Coordinated Motion, the TP, the State Tracker, Callbacks, etc... Also a Thread should be created because the call could block for a long time. Also everything needs to be flushed afterward so the motion begins, finishes, and errors are handled.
>
>
>
> If you could explain the need a bit more, and do all the work and testing :} We could merge in the changes as long as it doesn't impact existing code.
>
>
>
> Regards
>
> TK
>
>
>
>
>
> From: bradodarb <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, January 22, 2012 9:20 AM
> Subject: [DynoMotion] Gcode Interpreter Feature Request
>
>
>
>
>
> Hello Tom,
>
> I have been implementing a c# version of the NIST EMC RS274 interpreter.
>
> In the source file driver.cc <http://driver.cc/> , you will find to means of feeding commands to the interpreter; interpret_from_file(args...) and interpret_from_keyboard(args...)
>
> I am sure you are aware of the keyboard function, as it looks like you used the standalone version of the interpreter and placed coordmotion calls/io state changes/etc.. in the canonical callbacks.
>
> Can you please expose this to GcodeInterpreter so we can have proper MDI support natively on the kflop?
>
> Here is the funtion in question::
>
> int interpret_from_keyboard( /* ARGUMENTS */
> int block_delete, /* switch which is ON or OFF */
> int print_stack) /* option which is ON or OFF */
> {
> char line[RS274NGC_TEXT_SIZE];
> int status;
>
> for(; ;)
> {
> printf("READ => ");
> gets(line);
> if (strcmp (line, "quit") IS 0)
> return 0;
> status SET_TO rs274ngc_read(line);
> if ((status IS RS274NGC_EXECUTE_FINISH) AND (block_delete IS ON));
> else if (status IS RS274NGC_ENDFILE);
> else if ((status ISNT RS274NGC_EXECUTE_FINISH) AND
> (status ISNT RS274NGC_OK))
> report_error(status, print_stack);
> else
> {
> status SET_TO rs274ngc_execute();
> if ((status IS RS274NGC_EXIT) OR
> (status IS RS274NGC_EXECUTE_FINISH));
> else if (status ISNT RS274NGC_OK)
> report_error(status, print_stack);
> }
> }
> }
>
> Thanks,
>
> Brad Murry
>
Group: DynoMotion Message: 3296 From: Tom Kerekes Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request
Hi Brad,
 
Likewise.  But you aren't convincing me.  I think you want to prevent issuing things while a program is running.   The results would be unpredictable.  I think the "halt" mechanism is much better for what you describe.
 
Regards
TK 

Group: DynoMotion Message: 3300 From: Brad Murry Date: 1/22/2012
Subject: Re: Gcode Interpreter Feature Request

Tom/Ray

 

Well like anything else… garbage in = garbage out.

 

If a user does not know what the implications are when using MDI, they should not use them(or if they do they will soon learn about them).

 

The company I work for has many metalworking CNC’s to make the machines I program and MDI commands to get injected into the part programs sometimes during setup of a new type of part.  I have used it in the past to dial in an offset as well.

 

-Brad Murry

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of himykabibble
Sent: Sunday, January 22, 2012 1:25 PM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Re: Gcode Interpreter Feature Request

 

 

"The problem is you cannot issue anything during running a program." - JMTCW - I HATE that idea. That is the kind of thing that caused me no end of grief in Mach3. Allowing injection of MDI commands like that REALLY complicates things, and (in my limited experience) I have a hard time seeing a legitimate reason to do that. To me, that's what FeedHold is for - you can strop the program, do what you need to do, then continue.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@...> wrote:
>
> Hello Tom,
>
>
>
> I’m glad you can take ‘proper’ with a sense of humor ;)
>
>
>
> I do like that the interpreter functions the same, but there is one sticking point that makes me want to side step it.
>
>
>
> The problem is you cannot issue anything during running a program.
>
>
>
> Normally, you would not need to, but sometimes(especially during setup of a new program) you may throw an M00 so you check things.
>
>
>
> During this M00 you may want to toggle Mcodes, etc…. Arguably you can perform IO calls with buttons, but most NC controls allow commands to be interpreted while a program is being executed. Another common use is to change tool heights, etc….
>
>
>
> If you can put it in the GcodeInterpreter.cpp side I will happily integrate it to the .net side(meet me half way?)
>
>
>
> -Brad Murry
>
>
>
> From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: Sunday, January 22, 2012 12:43 PM
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Gcode Interpreter Feature Request
>
>
>
>
>
> Hi Brad,
>
>
>
> We already have "proper" MDI functionality :}
>
>
>
> I guess you are referring to the issue where the current technique involves creating a 1 line file to execute. I agree it wastes 100us of CPU time, but it only happens as fast as a person can type or click so it is negligible. The benefit is it guarantees exact same functionality as single stepping through a file.
>
>
>
> Maybe I don't understand the issue. But the function you mention seems like is some command line thing where the user is expected to type "quit" and so forth. Is that what you really want? Also there are a number of things that need to be setup before calling the Interpreter with regard to Initializing the Coordinated Motion, the TP, the State Tracker, Callbacks, etc... Also a Thread should be created because the call could block for a long time. Also everything needs to be flushed afterward so the motion begins, finishes, and errors are handled.
>
>
>
> If you could explain the need a bit more, and do all the work and testing :} We could merge in the changes as long as it doesn't impact existing code.
>
>
>
> Regards
>
> TK
>
>
>
>
>
> From: bradodarb <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, January 22, 2012 9:20 AM
> Subject: [DynoMotion] Gcode Interpreter Feature Request
>
>
>
>
>
> Hello Tom,
>
> I have been implementing a c# version of the NIST EMC RS274 interpreter.
>
> In the source file driver.cc <http://driver.cc/> , you will find to means of feeding commands to the interpreter; interpret_from_file(args...) and interpret_from_keyboard(args...)
>
> I am sure you are aware of the keyboard function, as it looks like you used the standalone version of the interpreter and placed coordmotion calls/io state changes/etc.. in the canonical callbacks.
>
> Can you please expose this to GcodeInterpreter so we can have proper MDI support natively on the kflop?
>
> Here is the funtion in question::
>
> int interpret_from_keyboard( /* ARGUMENTS */
> int block_delete, /* switch which is ON or OFF */
> int print_stack) /* option which is ON or OFF */
> {
> char line[RS274NGC_TEXT_SIZE];
> int status;
>
> for(; ;)
> {
> printf("READ => ");
> gets(line);
> if (strcmp (line, "quit") IS 0)
> return 0;
> status SET_TO rs274ngc_read(line);
> if ((status IS RS274NGC_EXECUTE_FINISH) AND (block_delete IS ON));
> else if (status IS RS274NGC_ENDFILE);
> else if ((status ISNT RS274NGC_EXECUTE_FINISH) AND
> (status ISNT RS274NGC_OK))
> report_error(status, print_stack);
> else
> {
> status SET_TO rs274ngc_execute();
> if ((status IS RS274NGC_EXIT) OR
> (status IS RS274NGC_EXECUTE_FINISH));
> else if (status ISNT RS274NGC_OK)
> report_error(status, print_stack);
> }
> }
> }
>
> Thanks,
>
> Brad Murry
>